package tt.love.hw.common;


import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import tt.love.hw.common.config.AppContext;


public class AppContextListener implements ServletContextListener {

	public void contextDestroyed(ServletContextEvent arg0) {
	}

	public void contextInitialized(ServletContextEvent event) {
		AppContext appcontext = new AppContext(event.getServletContext().getResourceAsStream("/WEB-INF/app-context.xml"));
		event.getServletContext().setAttribute("appcontext", appcontext);
		AppContextHolder.setAppcontext(appcontext);
		event.getServletContext().setAttribute("resourceBundleContext", new ResourceBundleContext());
	}

}
